<link rel="stylesheet" href="lib/datatables/css/table_jui.css"
	type="text/css" />
<div id="content_wrapper">
<div id="main_content" class="cf">

<h1 class="sepH_c">Danh sách <?php
if ($_GET["cat_id"] == 1) echo "Tin tức";
elseif ($_GET["cat_id"] == 2) echo "Tuyển dụng";
else echo "tin bosch";
?></h1>
<div class="sepH_a"><a href="javascript:void(0)" class="delete_all_dt">Delete
selected</a></div>
<table class="display" id="content_table">
	<thead>
		<tr>
			<th class="chb_col">
			<div class="th_wrapp"><input type="checkbox"
				class="chSel_all inpt_c1" /></div>
			</th>
			<th>
			<div class="th_wrapp">Tiêu đề Tin</div>
			</th>
			<th>
			<div class="th_wrapp">Người nhập</div>
			</th>
			<th>
			<div class="th_wrapp">Ngày đăng</div>
			</th>			
			<th>
			<div class="th_wrapp">Chức năng</div>
			</th>
		</tr>
	</thead>
	<tbody>
							<?php
							$news->setcat_id($_GET["cat_id"]);
							$list = $news->listbycat();
							for($i = 0; $i < count ( $list ); $i ++) {
								?>
								<tr>
			<td class="chb_col"><input type="checkbox" name="row_sel"	value="<?=$list [$i] ["id"]?>" class="inpt_c1" /></td>
			<td><a href="index.php?m=<?=$m?>&act=edit&id=<?=$list [$i] ["id"]?>"><?=$list [$i] ["title"]?></a></td>
			<td></td>
                
									<td><?=date("d/m/Y",$list [$i] ["date"])?></td>
			<td class="content_actions"><a	href="index.php?m=<?=$m?>&act=edit&cat_id=<?=$_GET["cat_id"]?>&id=<?=$list [$i] ["id"]?>"
				class="sepV_a" title="Edit"><img src="images/icons/pencil.png" alt="" /></a><a	href="index.php?m=<?=$m?>&act=del&cat_id=<?=$_GET["cat_id"]?>&id=<?=$list [$i] ["id"]?>" title="Delete" class="sepV_a"><img src="images/icons/trashcan.png"
				alt="" /></a></td>
		</tr>
							<?php
							}
							?>
							</tbody>
</table>
</div>
</div>
<script type="text/javascript">
		head.js(
			"js/jquery-1.6.2.min.js",
			"lib/datatables/jquery.dataTables.min.js",
			"lib/datatables/dataTables.plugins.js",
			"lib/fusion-charts/FusionCharts.js",
			"js/jquery.microaccordion.js",
			"js/jquery.tools.min.js",
			"js/jquery.stickyPanel.js",
			"js/jquery.text-overflow.min.js",
			"js/xbreadcrumbs.js",
			"js/jquery.stickyPanel.js",
			"js/lagu.js",
			function(){
				lga_dataTables = {
						lga_contentTable: function(){
							$('#content_table').dataTable({
								"sPaginationType": "full_numbers",
								"aaSorting": [[ 1, "desc" ]],
								"aoColumns": [
									{ "bSortable": false },
									{ "sType": "natural" },
									{ "sType": "natural" },
									{ "bSortable": false },
									{ "bSortable": false }
								]
							});
						}
					};

				lga_dataTables.lga_contentTable();
				lga_fusionCharts.chart_k();
				$('.chSel_all').click(function () {
					$(this).closest('table').find('input[name=row_sel]').attr('checked', this.checked);
				});
				$('.delete_all_dt').click( function() {
					oTable = $('#content_table').dataTable();
					$('input[@name=row_sel]:checked', oTable.fnGetNodes()).closest('tr').fadeTo(600, 0, function () {
						oTable.fnDeleteRow( this );
						
						$('.chSel_all','#content_table').attr('checked',false);
						return false;
					});
					// Delete row
					$('input[@name=row_sel]:checked').each(function(){
						var get_id = $(this).val();
						$.get('action.php?m=city&act=ajax&id='+get_id, function(data) {
//							$('.result').html(data);
							//alert(data);
						});
					});
				});
			}
		)
    </script>